package old.cn.ly.creatinalPatterns.factory.simpleFactory;

import old.cn.ly.bean.fruit.Applet;
import old.cn.ly.bean.fruit.Fruit;
import old.cn.ly.bean.fruit.Grape;
import old.cn.ly.bean.fruit.StrawBerry;

public class FruitGardener {
	public static Fruit facotry(String which){
		if(which.equals("apple")){
			return new Applet();
		}else if(which.equals("Grape")){
			return new Grape();
		}else if(which.equals("berry")){
			return new StrawBerry();
		}else{
			throw new RuntimeException();
		}
		
	}
}
